package com.changgou.goods.dao;

import com.changgou.goods.pojo.Spec;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;
import java.util.Map;

public interface SpecMapper extends Mapper<Spec> {
    /**
     * 根据分类名称查询规格信息
     * @param categoryName
     * @return
     */
    @Select("SELECT DISTINCT s.name,s.options FROM tb_category c,tb_spec s WHERE c.template_id = s.template_id AND c.name = #{name}")
    public List<Map> findSpecListByCategoryName(@Param("name") String categoryName);

}
